-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert internal rc_getline() calls to getline() calls #278
base: master
Are you sure you want to change the base?
Conversation
65ed3ef
to
f181d0c
Compare
getline has been in posix since POSIX.1-2008, so it should be safe for us to use it instead of using our wrapper function. This fixes OpenRC#278.
I would like to call for some testers to make sure this works before I merge it. Please report back here. |
getline's behavior does not match rc_getline's in various ways, like whether the newline is included if found (getline: yes, rc_getline: no). You should just make rc_getline a wrapper for getline, so that this can be fixed in one location, instead of having to do it in several. |
@dwfreed The whole reason rc_getline was written was because getline wasn't standard when it was needed. Also, the code already uses both rc_getline and getline. I think I would still rather migrate to getline. |
@dwfreed I see that rc_getline is only used in librc. If I do a wrapper, I would want it to be private to the library, not available for general use. |
the low usage rates implies it's not a big deal to drop even if it slightly simplifies trailing newline semantics. everyone is used to the posix api at this point so it's a bit of a lost battle. technically we'd need to keep the symbol just to not break abi. |
@vapier I could use some insight here. Is it ok in this case because of the low usage to break abi and restore it if someone complains? If not, I guess it means that if I keep the symbol I have to keep the function? |
getline has been in posix since POSIX.1-2008, so it should be safe for us to use it instead of using our wrapper function. This fixes OpenRC#278.
f181d0c
to
3b10265
Compare
I'm not able to do a proper review right now, but a quick look indicates many of the consumers of rc_getline expect and need the newline dropping semantics. The sheer quantity suggests it would be better to just use rc_getline as a wrapper around getline to drop the newline, otherwise you will have to implement that in several places, which seems error prone and a waste of effort. |
getline has been in posix since POSIX.1-2008, so it should be safe for us to use it instead of using our wrapper function. This fixes OpenRC#278.
3b10265
to
3af59e9
Compare
getline has been in posix since POSIX.1-2008, so it should be safe for us to use it instead of our wrapper function.
3af59e9
to
e610020
Compare
getline has been in posix since POSIX.1-2008, so it should be safe for
us to use it instead of using our wrapper function.